using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BookInfoCS
{
    [ToolboxData("<{0}:SampleCompareValidator runat=server></{0}:SampleCompareValidator>")]
    public class SampleCompareValidator : System.Web.UI.WebControls.BaseCompareValidator
    {
        protected override bool EvaluateIsValid()
        {
            string strTestValue;
            string strTestControl;
            strTestControl = this.ControlToValidate;
            strTestValue = this.GetControlValidationValue(strTestControl);
            object objValue;
            if (BaseCompareValidator.CanConvert(strTestValue, ValidationDataType.Integer) != true)
            {
                BaseCompareValidator.Convert(strTestValue, ValidationDataType.Integer, out objValue);
                if (objValue.ToString() == "0") 
                {
                 return false;
                }
                else
                {
                return true;   
                }
            }
            else
            {
                return false;
            }
        }
    }
}
